﻿/******************************************************************************
 * Author:      671643387
 * Created:     2016/10/25
 *****************************************************************************/

/// <summary>
/// 用户信息
/// </summary>
public class UserInfo
{
	///////////////////////////////////////////////////////////////////////////
	//>> 变量

	/// <summary>
	/// 平台编号
	/// </summary>
	private string _openid;

	/// <summary>
	/// 用户编号
	/// </summary>
	private int _uid;

	/// <summary>
	/// 用户名
	/// </summary>
	private string _name;

	/// <summary>
	/// 用户头像
	/// </summary>
	private string _headpic;

	/// <summary>
	/// 用户性别
	/// </summary>
	private int _sex;

	/// <summary>
	/// 房卡
	/// </summary>
	private int _card;

	/// <summary>
	/// 积分
	/// </summary>
	private int _score;

	/// <summary>
	/// 用户地址
	/// </summary>
	private string _ip;

	/// <summary>
	/// 游戏次数
	/// </summary>
	private int _playNum;

	/// <summary>
	/// 房间号
	/// </summary>
	private int _roomId;

	/// <summary>
	/// 地区
	/// </summary>
	private string _province;

	///////////////////////////////////////////////////////////////////////////
	//>> 函数

	/// <summary>
	/// 构造函数
	/// </summary>
	public UserInfo ()
	{
		_openid = null;
		_uid = 0;
		_name = null;
		_headpic = null;
		_sex = 0;
		_card = 0;
		_score = 0;
		_ip = "127.0.0.1";
		_playNum = 0;
		_roomId = 0;
		_province = "";
	}

	public string openid {
		get { return _openid; }
		set { _openid = value; }
	}

	public int uid {
		get { return _uid; }
		set { _uid = value; }
	}

	public string name {
		get { return _name; }
		set { _name = value; }
	}

	public string headpic {
		get { return _headpic; }
		set { _headpic = value; }
	}

	public int sex {
		get { return _sex; }
		set { _sex = value; }
	}

	public int card {
		get { return _card; }
		set { _card = value; }
	}

	public int score {
		get { return _score; }
		set { _score = value; }
	}

	public string ip {
		get { return _ip; }
		set { _ip = value; }
	}

	public int playNum {
		get { return _playNum; }
		set { _playNum = value; }
	}

	public int roomId {
		get { return _roomId; }
		set { _roomId = value; }
	}

	public string province {
		get { return _province; }
		set { _province = value; }
	}
	public string getProvince() {
		string name = "";
		switch (_province) {
		case "Hebei": name = "河北"; break;
		case "Shanxi": name = "山西"; break;
		case "Liaoling": name = "辽宁"; break;
		case "Jilin": name = "吉林"; break;
		case "Heilongjiang": name = "黑龙江"; break;
		case "Jiangsu": name = "江苏"; break;
		case "Zhejiang": name = "浙江"; break;
		case "Anhui": name = "安徽"; break;
		case "Fujiang": name = "福建"; break;
		case "Jiangxi": name = "江西"; break;
		case "Shandong": name = "山东"; break;
		case "Henan": name = "河南"; break;
		case "Hubei": name = "湖北"; break;
		case "Hunan": name = "湖南"; break;
		case "Guangdong": name = "广东"; break;
		case "Hainan": name = "海南"; break;
		case "Sichuan": name = "四川"; break;
		case "Guizhou": name = "贵州"; break;
		case "Yunnan": name = "云南"; break;
		//case "Shanxi": name = "陕西"; break;
		case "Gansu": name = "甘肃"; break;
		case "Qinhai": name = "青海"; break;
		case "Taiwang": name = "台湾"; break;
		default:
			name = _province;
			break;
		}
		return name;
	}
}